﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace Shop.MVC.Models
{
    /// <summary>
    ///  用户注册的视图模型
    /// </summary>
    public class UserRegVM
    {
        [Display(Name ="用户名")]
        [Required(ErrorMessage ="{0}必填")]
        public string Name { get; set; }

        [Display(Name = "手机号")]
        [Required(ErrorMessage = "{0}必填")]
        public string Phone { get; set; }

        [Display(Name = "密码")]
        [Required(ErrorMessage = "{0}必填")]
        [StringLength(maximumLength:20,MinimumLength =6,ErrorMessage ="6-20位之间")]
        public string Password { get; set; }


        [Display(Name = "确认密码")]
        [Compare(nameof(Password),ErrorMessage ="两次密码不一致")]
        public string ConfirmPassword { get; set; }

    }
}